package com.revenant.driver.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.revenant.driver.R;
import com.revenant.driver.bean.AreaShowBean;
import com.revenant.driver.bean.NewDriverAddInfo;

/**
 * @ProjectName: Shipper
 * @Package: com.revenant.shipper.adapter
 * @ClassName: MineBigItemAdapter
 * @Description: java类作用描述
 * @Author: revenant
 * @CreateDate: 2019-12-30 14:18
 * @UpdateUser: 更新者
 * @UpdateDate: 2019-12-30 14:18
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public class AddNewDriverInfoAdaper extends BaseQuickAdapter<NewDriverAddInfo, BaseViewHolder> {

    public AddNewDriverInfoAdaper() {
        super(R.layout.newshowitem);
    }

    @Override
    protected void convert(BaseViewHolder helper, NewDriverAddInfo item) {
        helper.setText(R.id.new_number, String.valueOf(helper.getLayoutPosition() + 1));
        helper.setText(R.id.new_right, item.getTitle());
        switch (item.getSelecttype()) {
            case -1:
                helper.setImageResource(R.id.new_image_head, item.getImage());
                break;
            case 0:
                Glide.with(mContext).load(item.getImageUrl()).placeholder(R.mipmap.congyezigezhneg).centerCrop().
                        into((ImageView) helper.getView(R.id.new_image_head));
                break;
        }
//        Glide.with(mContext).load(item.getImage()).centerCrop().
//                into((ImageView) helper.getView(R.id.new_image_head));

    }
}
